global class WBSelectUserController extends WBController{
	public WBSelectUserController(){
		Lead l = [select name from Lead where Id = :ApexPages.currentPage().getParameters().get('Id')];
		keyword = l.name;
		search_suggestions_users();
	}
	
	@RemoteAction
	global static void LeadUid(string lead_id,string weibo_uid){
		WBSfdcInfo.LeadUid(lead_id, weibo_uid);
	}

	// ---------------- Common function ------------------
	public PageReference SignOut(){
		try{
	    User u = [select id,weibo_code__c,weibo_access_token__c,weibo_expires_in__c,weibo_uid__c
	    					from user where id=:UserInfo.getUserId()];
	    u.weibo_code__c = '';
	    u.weibo_access_token__c =  '';
	    u.weibo_expires_in__c = 0;
	    u.weibo_uid__c = '';
	    update u;
			//WBSfdcInfo.instance().resetWeiboUserInfo();
			return Page.WeiboLead;
		}
		catch(DMLException e){
			ApexPages.addMessage(new ApexPages.message(ApexPages.Severity.ERROR, e.getMessage()));
		}
		return null;
	}
}